package json;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 黄乾坤
 * @create 2022-04-22 11:18
 */
public class LogJson {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("url");
        list.add("method");
        list.add("params");
        list.add("raw");
        list.add("connectTimeout");
        list.add("readTimeout");

        for (int i = 0; i < list.size(); i++) {
            if (i == 0) {
                System.out.print("log.info(new StringBuilder(\"{\\\"" + list.get(i) + "\\\":\\\"\").append(" + list.get(i) + ")");
            }else{
                System.out.print(".append(\"\\\", \\\"" + list.get(i) + "\\\":\\\"\").append(" + list.get(i) + ")");
            }
        }
        System.out.println(".append(\"\\\"}\").toString());");
    }

}
